<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
	.KEYW {color: #933;}
	.COMM {color: #bbb; font-style: italic;}
	.NUMB {color: #393;}
	.STRN {color: #393;}
	.REGX {color: #339;}
	.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
	</style></head><body><pre><span class='line'>  1</span> <span class="COMM">/*****************************************************************************
<span class='line'>  2</span> * Cal3D 3d character animation library
<span class='line'>  3</span> * Copyright (C) 2001, 2002 Bruno 'Beosil' Heidelberger
<span class='line'>  4</span> *
<span class='line'>  5</span> * This library is free software; you can redistribute it and/or modify it
<span class='line'>  6</span> * under the terms of the GNU Lesser General Public License as published by
<span class='line'>  7</span> * the Free Software Foundation; either version 2.1 of the License, or (at
<span class='line'>  8</span> * your option) any later version.
<span class='line'>  9</span> *****************************************************************************/</span><span class="WHIT">
<span class='line'> 10</span> 
<span class='line'> 11</span> </span><span class="COMM">/*****************************************************************************
<span class='line'> 12</span> * Cal3DJS Javascript port of Cal3D for WebGL and canvas applications
<span class='line'> 13</span> * by Humu humu2009@gmail.com
<span class='line'> 14</span> * http://code.google.com/p/cal3djs/
<span class='line'> 15</span> *****************************************************************************/</span><span class="WHIT">
<span class='line'> 16</span> 
<span class='line'> 17</span> 
<span class='line'> 18</span> </span><span class="COMM">/**
<span class='line'> 19</span> 	@class CalCoreMaterial
<span class='line'> 20</span> */</span><span class="WHIT">
<span class='line'> 21</span> </span><span class="NAME">Cal3D.CalCoreMaterial</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 22</span> </span><span class="WHIT">	</span><span class="NAME">this.m_ambientColor</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Cal3D.CalCoreMaterial.Color</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 23</span> </span><span class="WHIT">	</span><span class="NAME">this.m_diffuseColor</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Cal3D.CalCoreMaterial.Color</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 24</span> </span><span class="WHIT">	</span><span class="NAME">this.m_specularColor</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Cal3D.CalCoreMaterial.Color</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 25</span> </span><span class="WHIT">	</span><span class="NAME">this.m_shininess</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 26</span> </span><span class="WHIT">	</span><span class="NAME">this.m_vectorMap</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 27</span> </span><span class="WHIT">	</span><span class="NAME">this.m_userData</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 28</span> </span><span class="WHIT">	</span><span class="NAME">this.m_name</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 29</span> </span><span class="WHIT">	</span><span class="NAME">this.m_filename</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 30</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 31</span> 
<span class='line'> 32</span> </span><span class="COMM">/**
<span class='line'> 33</span> 	Get the ambient color.&lt;br />
<span class='line'> 34</span> 	This function returns the ambient color of the core material instance.
<span class='line'> 35</span> 	@returns {Cal3D.CalCoreMaterial.Color} The ambient color.
<span class='line'> 36</span> */</span><span class="WHIT">
<span class='line'> 37</span> </span><span class="NAME">Cal3D.CalCoreMaterial.prototype.getAmbientColor</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 38</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.m_ambientColor</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 39</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 40</span> 
<span class='line'> 41</span> </span><span class="COMM">/**
<span class='line'> 42</span> 	Get the diffuse color.&lt;br />
<span class='line'> 43</span> 	This function returns the diffuse color of the core material instance.
<span class='line'> 44</span> 	@returns {Cal3D.CalCoreMaterial.Color} The diffuse color.
<span class='line'> 45</span> */</span><span class="WHIT">
<span class='line'> 46</span> </span><span class="NAME">Cal3D.CalCoreMaterial.prototype.getDiffuseColor</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 47</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.m_diffuseColor</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 48</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 49</span> 
<span class='line'> 50</span> </span><span class="COMM">/**
<span class='line'> 51</span> 	Get the number of texture maps.&lt;br />
<span class='line'> 52</span> 	This function returns the number of texture mapss in the core material instance.
<span class='line'> 53</span> 	@returns {number} The number of texture maps.
<span class='line'> 54</span> */</span><span class="WHIT">
<span class='line'> 55</span> </span><span class="NAME">Cal3D.CalCoreMaterial.prototype.getMapCount</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 56</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.m_vectorMap.length</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 57</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 58</span> 
<span class='line'> 59</span> </span><span class="COMM">/**
<span class='line'> 60</span> 	Get a specified map texture filename.&lt;br />
<span class='line'> 61</span> 	This function returns the texture filename for a specified map ID of the core material instance.
<span class='line'> 62</span> 	@param {number} mapId The ID of the texture map.
<span class='line'> 63</span> 	@returns {string} The filename of the map texture. An empty string will be returned if the map does not exist.
<span class='line'> 64</span> */</span><span class="WHIT">
<span class='line'> 65</span> </span><span class="NAME">Cal3D.CalCoreMaterial.prototype.getMapFilename</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">mapId</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 66</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">mapId</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">mapId</span><span class="WHIT"> </span><span class="PUNC">>=</span><span class="WHIT"> </span><span class="NAME">this.m_vectorMap.length</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 67</span> </span><span class="WHIT">		</span><span class="NAME">Cal3D.CalError.setLastError</span><span class="PUNC">(</span><span class="NAME">Cal3D.CalError.Code.INVALID_HANDLE</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'corematerial.js'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 68</span> </span><span class="WHIT">		</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 69</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 70</span> 
<span class='line'> 71</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">map</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.m_vectorMap</span><span class="PUNC">[</span><span class="NAME">mapId</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 72</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">map</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 73</span> </span><span class="WHIT">		</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 74</span> 
<span class='line'> 75</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">map.filename</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 76</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 77</span> 
<span class='line'> 78</span> </span><span class="COMM">/**
<span class='line'> 79</span> 	Get user data of a specified textue map.&lt;br />
<span class='line'> 80</span> 	This function returns the user data stored in the specified map of the core material instance.
<span class='line'> 81</span> 	@param {number} mapId The ID of the texture map.
<span class='line'> 82</span> 	@returns {object} The user data stored in the specified map; null if the map does not exist.
<span class='line'> 83</span> */</span><span class="WHIT">
<span class='line'> 84</span> </span><span class="NAME">Cal3D.CalCoreMaterial.prototype.getMapUserData</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">mapId</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 85</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">mapId</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">mapId</span><span class="WHIT"> </span><span class="PUNC">>=</span><span class="WHIT"> </span><span class="NAME">this.m_vectorMap.length</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 86</span> </span><span class="WHIT">		</span><span class="NAME">Cal3D.CalError.setLastError</span><span class="PUNC">(</span><span class="NAME">Cal3D.CalError.Code.INVALID_HANDLE</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'corematerial.js'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 87</span> </span><span class="WHIT">		</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 88</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 89</span> 
<span class='line'> 90</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">map</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.m_vectorMap</span><span class="PUNC">[</span><span class="NAME">mapId</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 91</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">map</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 92</span> </span><span class="WHIT">		</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 93</span> 
<span class='line'> 94</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">map.userData</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 95</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 96</span> 
<span class='line'> 97</span> </span><span class="COMM">/**
<span class='line'> 98</span> 	Get the shininess factor.&lt;br />
<span class='line'> 99</span> 	This function returns the shininess factor of the core material instance.
<span class='line'>100</span> 	@returns {number} The shininess factor.
<span class='line'>101</span> */</span><span class="WHIT">
<span class='line'>102</span> </span><span class="NAME">Cal3D.CalCoreMaterial.prototype.getShininess</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>103</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.m_shininess</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>104</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>105</span> 
<span class='line'>106</span> </span><span class="COMM">/**
<span class='line'>107</span> 	Get the specular color.&lt;br />
<span class='line'>108</span> 	This function returns the specular color of the core material instance.
<span class='line'>109</span> 	@returns {Cal3D.CalCoreMaterial.Color} The specular color.
<span class='line'>110</span> */</span><span class="WHIT">
<span class='line'>111</span> </span><span class="NAME">Cal3D.CalCoreMaterial.prototype.getSpecularColor</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>112</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.m_specularColor</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>113</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>114</span> 
<span class='line'>115</span> </span><span class="COMM">/**
<span class='line'>116</span> 	Get the user data stored in this core material.&lt;br />
<span class='line'>117</span> 	This function returns the user data stored in the core material instance.
<span class='line'>118</span> 	@returns {object} The user data stored in the core material.
<span class='line'>119</span> */</span><span class="WHIT">
<span class='line'>120</span> </span><span class="NAME">Cal3D.CalCoreMaterial.prototype.getUserData</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>121</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.m_userData</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>122</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>123</span> 
<span class='line'>124</span> </span><span class="COMM">/**
<span class='line'>125</span> 	Get the map array.&lt;br />
<span class='line'>126</span> 	This function returns the array that contains all maps of the core material instance.
<span class='line'>127</span> 	@returns {array} The map array.
<span class='line'>128</span> */</span><span class="WHIT">
<span class='line'>129</span> </span><span class="NAME">Cal3D.CalCoreMaterial.prototype.getVectorMap</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>130</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.m_vectorMap</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>131</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>132</span> 
<span class='line'>133</span> </span><span class="COMM">/**
<span class='line'>134</span> 	Allocate space for the maps&lt;br />
<span class='line'>135</span> 	This function reserves space for the maps of the core material instance.
<span class='line'>136</span> 	@param {number} mapCount The number of maps that this core material should holds.
<span class='line'>137</span> 	@returns {boolean} true, if succeeded; false if failed.
<span class='line'>138</span> */</span><span class="WHIT">
<span class='line'>139</span> </span><span class="NAME">Cal3D.CalCoreMaterial.prototype.reserve</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">mapCount</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>140</span> </span><span class="WHIT">	</span><span class="NAME">this.m_vectorMap</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Array</span><span class="PUNC">(</span><span class="NAME">mapCount</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>141</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>142</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>143</span> 
<span class='line'>144</span> </span><span class="COMM">/**
<span class='line'>145</span> 	Set the ambient color.&lt;br />
<span class='line'>146</span> 	This function sets the ambient color of the core material instance.
<span class='line'>147</span> 	@param {Cal3D.CalCoreMaterial.Color} ambientColor The ambient color to set.
<span class='line'>148</span> */</span><span class="WHIT">
<span class='line'>149</span> </span><span class="NAME">Cal3D.CalCoreMaterial.prototype.setAmbientColor</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">ambientColor</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>150</span> </span><span class="WHIT">	</span><span class="NAME">this.m_ambientColor.red</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">ambientColor.red</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>151</span> </span><span class="WHIT">	</span><span class="NAME">this.m_ambientColor.green</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">ambientColor.green</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>152</span> </span><span class="WHIT">	</span><span class="NAME">this.m_ambientColor.blue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">ambientColor.blue</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>153</span> </span><span class="WHIT">	</span><span class="NAME">this.m_ambientColor.alpha</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">ambientColor.alpha</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>154</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>155</span> 
<span class='line'>156</span> </span><span class="COMM">/**
<span class='line'>157</span> 	Set the diffuse color.&lt;br />
<span class='line'>158</span> 	This function sets the diffuse color of the core material instance.
<span class='line'>159</span> 	@param {Cal3D.CalCoreMaterial.Color} diffuseColor The diffuse color to set.
<span class='line'>160</span> */</span><span class="WHIT">
<span class='line'>161</span> </span><span class="NAME">Cal3D.CalCoreMaterial.prototype.setDiffuseColor</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">diffuseColor</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>162</span> </span><span class="WHIT">	</span><span class="NAME">this.m_diffuseColor.red</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">diffuseColor.red</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>163</span> </span><span class="WHIT">	</span><span class="NAME">this.m_diffuseColor.green</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">diffuseColor.green</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>164</span> </span><span class="WHIT">	</span><span class="NAME">this.m_diffuseColor.blue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">diffuseColor.blue</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>165</span> </span><span class="WHIT">	</span><span class="NAME">this.m_diffuseColor.alpha</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">diffuseColor.alpha</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>166</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>167</span> 
<span class='line'>168</span> </span><span class="COMM">/**
<span class='line'>169</span> 	Set a specified texture map.&lt;br />
<span class='line'>170</span> 	This function sets a specified map in the core material instance.
<span class='line'>171</span> 	@param {number} mapId The ID of the map.
<span class='line'>172</span> 	@param {Cal3D.CalCoreMaterial.Map} map The map to be set.
<span class='line'>173</span> 	@returns {boolean} true if succeeded; false if the map does not exist.
<span class='line'>174</span> */</span><span class="WHIT">
<span class='line'>175</span> </span><span class="NAME">Cal3D.CalCoreMaterial.prototype.setMap</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">mapId</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">map</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>176</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">mapId</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">mapId</span><span class="WHIT"> </span><span class="PUNC">>=</span><span class="WHIT"> </span><span class="NAME">this.m_vectorMap.length</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>177</span> </span><span class="WHIT">		</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>178</span> 
<span class='line'>179</span> </span><span class="WHIT">	</span><span class="NAME">this.m_vectorMap</span><span class="PUNC">[</span><span class="NAME">mapId</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">map</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>180</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>181</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>182</span> 
<span class='line'>183</span> </span><span class="COMM">/**
<span class='line'>184</span> 	Store specified map user data.&lt;br />
<span class='line'>185</span> 	This function stores user data in a specified map of the core material instance.
<span class='line'>186</span> 	@param {number} mapId The ID of the map.
<span class='line'>187</span> 	@param {object} userData The map to be set.
<span class='line'>188</span> 	@returns {boolean} true if succeeded; false if the map does not exist.
<span class='line'>189</span> */</span><span class="WHIT">
<span class='line'>190</span> </span><span class="NAME">Cal3D.CalCoreMaterial.prototype.setMapUserData</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">mapId</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">userData</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>191</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">mapId</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">mapId</span><span class="WHIT"> </span><span class="PUNC">>=</span><span class="WHIT"> </span><span class="NAME">this.m_vectorMap.length</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>192</span> </span><span class="WHIT">		</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>193</span> 
<span class='line'>194</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">map</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.m_vectorMap</span><span class="PUNC">[</span><span class="NAME">mapId</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>195</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">map</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>196</span> </span><span class="WHIT">		</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>197</span> 
<span class='line'>198</span> </span><span class="WHIT">	</span><span class="NAME">map.userData</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">userData</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>199</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>200</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>201</span> 
<span class='line'>202</span> </span><span class="COMM">/**
<span class='line'>203</span> 	Set the shininess factor.&lt;br />
<span class='line'>204</span> 	This function sets the shininess factor of the core material instance.
<span class='line'>205</span> 	@param {number} shininess The shininess factor to be set.
<span class='line'>206</span> */</span><span class="WHIT">
<span class='line'>207</span> </span><span class="NAME">Cal3D.CalCoreMaterial.prototype.setShininess</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">shininess</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>208</span> </span><span class="WHIT">	</span><span class="NAME">this.m_shininess</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">shininess</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>209</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>210</span> 
<span class='line'>211</span> </span><span class="COMM">/**
<span class='line'>212</span> 	Set the specular color.&lt;br />
<span class='line'>213</span> 	This function sets the specular color of the core material instance.
<span class='line'>214</span> 	@param {Cal3D.CalCoreMaterial.Color} ambientColor The specular color to be set.
<span class='line'>215</span> */</span><span class="WHIT">
<span class='line'>216</span> </span><span class="NAME">Cal3D.CalCoreMaterial.prototype.setSpecularColor</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">specularColor</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>217</span> </span><span class="WHIT">	</span><span class="NAME">this.m_specularColor.red</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">specularColor.red</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>218</span> </span><span class="WHIT">	</span><span class="NAME">this.m_specularColor.green</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">specularColor.green</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>219</span> </span><span class="WHIT">	</span><span class="NAME">this.m_specularColor.blue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">specularColor.blue</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>220</span> </span><span class="WHIT">	</span><span class="NAME">this.m_specularColor.alpha</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">specularColor.alpha</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>221</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>222</span> 
<span class='line'>223</span> </span><span class="COMM">/**
<span class='line'>224</span> 	Set the name of the file in which the core material is stored, if any.&lt;br />
<span class='line'>225</span> 	@param {string} filename The file name.
<span class='line'>226</span> */</span><span class="WHIT">
<span class='line'>227</span> </span><span class="NAME">Cal3D.CalCoreMaterial.prototype.setFilename</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">filename</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>228</span> </span><span class="WHIT">	</span><span class="NAME">this.m_filename</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">filename</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>229</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>230</span> 
<span class='line'>231</span> </span><span class="COMM">/**
<span class='line'>232</span> 	Get the name of the file in which the core material is stored, if any.&lt;br />
<span class='line'>233</span> 	@returns {string} The file name. An empty string will be returned if the material is not stored in a file.
<span class='line'>234</span> */</span><span class="WHIT">
<span class='line'>235</span> </span><span class="NAME">Cal3D.CalCoreMaterial.prototype.getFilename</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>236</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.m_filename</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>237</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>238</span> 
<span class='line'>239</span> </span><span class="COMM">/**
<span class='line'>240</span> 	Set the symbolic name of the core material.&lt;br />
<span class='line'>241</span> 	@param {string} name The symbolic name to be set.
<span class='line'>242</span> */</span><span class="WHIT">
<span class='line'>243</span> </span><span class="NAME">Cal3D.CalCoreMaterial.prototype.setName</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">name</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>244</span> </span><span class="WHIT">	</span><span class="NAME">this.m_name</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">name</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>245</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>246</span> 
<span class='line'>247</span> </span><span class="COMM">/**
<span class='line'>248</span> 	Get the symbolic name of the core material.&lt;br />
<span class='line'>249</span> 	@returns {string} The symbolic name of the material. An empty string will be returned if the material is not associated to a symbolic name yet.
<span class='line'>250</span> */</span><span class="WHIT">
<span class='line'>251</span> </span><span class="NAME">Cal3D.CalCoreMaterial.prototype.getName</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>252</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.m_name</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>253</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>254</span> 
<span class='line'>255</span> </span><span class="COMM">/**
<span class='line'>256</span> 	Store user data.&lt;br />
<span class='line'>257</span> 	This function stores user data in the core material instance.
<span class='line'>258</span> 	@param {object} userData The use data to be stored in this material.
<span class='line'>259</span> */</span><span class="WHIT">
<span class='line'>260</span> </span><span class="NAME">Cal3D.CalCoreMaterial.prototype.setUserData</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">userData</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>261</span> </span><span class="WHIT">	</span><span class="NAME">this.m_userData</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">userData</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>262</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>263</span> 
<span class='line'>264</span> 
<span class='line'>265</span> </span><span class="COMM">/**
<span class='line'>266</span> 	@class Color
<span class='line'>267</span> 
<span class='line'>268</span> 	The core material color structure.
<span class='line'>269</span> */</span><span class="WHIT">
<span class='line'>270</span> </span><span class="NAME">Cal3D.CalCoreMaterial.Color</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>271</span> </span><span class="WHIT">	</span><span class="NAME">this.red</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>272</span> </span><span class="WHIT">	</span><span class="NAME">this.green</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>273</span> </span><span class="WHIT">	</span><span class="NAME">this.blue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>274</span> </span><span class="WHIT">	</span><span class="NAME">this.alpha</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>275</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>276</span> 
<span class='line'>277</span> 
<span class='line'>278</span> 
<span class='line'>279</span> </span><span class="COMM">/**
<span class='line'>280</span> 	@class Map
<span class='line'>281</span> 
<span class='line'>282</span> 	The core material map structure.
<span class='line'>283</span> */</span><span class="WHIT">
<span class='line'>284</span> </span><span class="NAME">Cal3D.CalCoreMaterial.Map</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>285</span> </span><span class="WHIT">	</span><span class="NAME">this.filename</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>286</span> </span><span class="WHIT">	</span><span class="NAME">this.userData</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>287</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>288</span> </span></pre></body></html>